<?php
/**
 * Created by PhpStorm.
 * User: Wenda Fang
 * Date: 14-1-5
 * Time: 上午10:59
 * Desc: Process the data from signin.html including validate and check the data
 */
session_start();

//登录
if(!isset($_POST['submit'])){
    exit('非法访问!');
}
$username = htmlspecialchars($_POST['username']);
$password = SHA1($_POST['password']);

if ($username == 'admin' || $password == SHA1('ixue123.cn')) {
    // Success sign in
    $_SESSION['username'] = $username;
    echo('欢迎'.$username.'，页面正在跳转中...');
    header("Location: index.php");
    exit;
} else {
    echo('用户名或密码错误，请重新输入');
    header("Location: signin.html");
}